var crypto = require('crypto'),
  key = 'salt_from',
  plaintext = '123456',
  cipher = crypto.createCipher('aes-256-cbc', key), //加密对象
  decipher = crypto.createDecipher('aes-256-cbc', key); //解密对象

cipher.update(plaintext,'utf8','hex');
var encryptedPassword = cipher.final('hex');

decipher.update(encryptedPassword,'hex','utf8');
var decryptedPassword = decipher.final('utf8');

console.log('encryptedPassword:'+encryptedPassword);
console.log('decryptedPassword:'+decryptedPassword);
